<!DOCTYPE html>
<html lang="en">
<head>
	<title> Hot Instagram Post Search | GugeeData </title>
	<meta name="viewport"
	      content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
	<meta name="description" content="Browse the most liked Instagram post with our Instagram post search feature. | GugeeData">
	<meta name="keywords" content="Instagram Hashtag, Most liked Instagram Post, Instagram Sponsored">
	<meta property="og:title" content="Hot Instagram Post Search | GugeeData">
	<meta property="og:description" content="Browse the most liked Instagram post with our Instagram post search feature. | GugeeData">
	<meta property="og:type" content="website">
	<meta property="og:url" content="https://www.gugeedata.com/instagram/hot-instagram-posts">
	<meta property="og:image" content=" https://seo-imags.s3.us-east-2.amazonaws.com/Logo.png">
	<meta name="twitter:title" content="Hot Instagram Post Search | GugeeData">
	<meta name="twitter:description" content="Browse the most liked Instagram post with our Instagram post search feature. | GugeeData">

	<link rel="icon" href="/static/img/favicon.ico" type="image/x-icon"/>
	<link rel="shortcut icon" href="/static/img/favicon.ico" type="image/x-icon"/>
	<link rel="stylesheet" href="/static/css/ins/common.css">
    <#if isMobile == false>
		<link rel="stylesheet" href="/static/plugins/layui/layui.css">
		<link rel="stylesheet" href="/static/css/ins/search.css">
    <#else>
		<link rel="stylesheet" href="${request.contextPath}/static/css/ins/mobile/search.css">
    </#if>
	<link rel="stylesheet" href="/static/css/ins/media.css">
    <#include "../../../component/facebookPixel.ftl">
</head>
<body>
<#include "../../../header_new1.ftl">
<main>
    <#if isMobile == false>
		<section class="search-bg" id="userSearch">
			<div class="container">
				<h1>Instagram Hot Post Search</h1>
				<h2>Browse the most liked Instagram post with our Instagram hot post search feature.</h2>
                <#include "../../component/search/commonFilter.ftl">
			</div>
		</section>
        <#include "../../component/search/commonWrap.ftl">
    <#else>
	    <section>
		    <div class="container">
			    <h1>Instagram Hot Post Search</h1>
			    <h2>Browse the most liked Instagram post with our Instagram hot post search feature.</h2>
		    </div>
	    </section>
        <#include "../../component/search/commonWrapMobile.ftl">
    </#if>
</main>
<script src="${request.contextPath}/static/js/dayjs.min.js"></script>
<script src="${request.contextPath}/static/js/time.js"></script>
<script src="/static/plugins/echarts.min.js"></script>
<script>
	const inputPlaceholder = 'Please enter hashtag or description'
	const initParams = {
        page: 1,
        pageSize: 10,
        mediaAdType: 0,
        sort: 4
    }
    let params = Object.assign({}, initParams)
    const tableHeader = [
	    {
            label: 'Hot',
            hasSort: true,
            sortIndex: 4,
		    width: 100,
            isActive: true,
            align: 'left'
	    },
        {
            label: 'Post Details',
	        align: 'left',
	        width: 600
        },
        {
            label: 'Views',
            hasSort: true,
            sortIndex: 0
        },
        {
            label: 'Likes',
            hasSort: true,
            sortIndex: 1
        },
        {
            label: 'Reviews',
            hasSort: true,
            sortIndex: 2
        },
        {
            label: 'ER',
            hasSort: true,
            sortIndex: 3,
            hasTip: true,
	        tipContent: 'ER = (Reviews + Likes) / Followers'
        },
        {
            label: 'Action'
        }
    ]
	const filterList = [
		{
			label: 'Categories',
			isMobileTab: true,
			requestOption: true,
			optionUrl: '/ins/dic/overall/category',

		},
		{
			isInline: true,
			items: [
				{
                    label: 'Type',
                    key: 'type',
                    options: [
                        {
                            label: 'All',
                            value: 0
                        },
                        {
                            label: 'Image',
                            value: 1
                        },
                        {
                            label: 'Video',
                            value: 2
                        },
	                    {
	                        label: 'Reels',
		                    value: 3
	                    },
	                    {
                            label: 'IGTV',
                            value: 4
	                    }
                    ]
				},
                {
                    label: 'Sponsored',
                    key: 'sponsored',
                    options: [
                        {
                            label: 'All',
                            value: 0
                        },
                        {
                            label: 'Yes',
                            value: 1
                        },
                        {
                            label: 'No',
                            value: 2
                        }
                    ]
                },
                {
                    label: 'Tagged',
                    type: 1,
                    placeHolder: 'Enter Tagged Username',
                    key: 'taggedUsername'
                }
			]
		},
		{
            label: 'Account Tagging',
            key: 'taggedAccount',
			type: 3,
            options: [
                {
					label: 'Tagged an account',
					value: 1
				},
				{
					label: 'Business account',
					value: 2
				},
				{
					label: 'Non-business account',
					value: 3
				},
            ]
		},
        {
            label: 'Product Tagging',
            key: 'taggedProduct',
            type: 3,
            options: [
                {
                    label: 'Tagged a product',
                    value: 1
                },
                {
                    label: 'Own product',
                    value: 2
                },
                {
                    label: 'Sponsored product',
                    value: 3
                },
            ]
        },
		{
		    label: 'Post Time',
			key: 'postingTime',
			options: [
				{
				    label: 'Last 6 Hours',
					value: 1
				},
                {
                    label: 'Last 12 Hours',
                    value: 2
                },
                {
                    label: 'Last 24 Hours',
                    value: 3
                },
				{
				    label: 'Last 3 days',
					value: 4
				},
                {
                    label: 'Last 7 days',
                    value: 5
                },
				{
                    label: 'Last 15 days',
                    value: 6
                },
                {
                    label: 'Last 30 days',
                    value: 0
                },
			]
		}
	]
	const mobileSearchTab = [
		{
		    label: 'Hot',
			align: 'left',
			icon: 'icondown1',
			type: 1,
			options: [
				{
                    label: 'Hot',
                    value: 4,
                    isActive: true
				},
				{
					label: 'Views',
					value: 0
				},
                {
                    label: 'Likes',
                    value: 1,
                },
                {
                    label: 'Reviews',
                    value: 2
                },
                {
                    label: 'ER',
                    value: 3
                },
			]
		},
		{
		    label: 'Categories',
			align: 'left',
            icon: 'icondown1',
            type: 2,
            roleId: 2,
        },
		{
		    label: 'Filter',
			align: 'right',
			icon: 'iconfilter-list',
            isFilter: true,
            roleId: 2,
		}
	]
</script>
<#include "../../component/search/commonScript.ftl">
<script type="module">
    import CommonSearch from '/static/component/search/commonSearch.js'
    import { collectAction, openDetail } from "/static/js/common.js"

    const commonSearch = new CommonSearch()
    commonSearch.setSearchFunc(searchUser)
    commonSearch.setReqFilterOptionsFunc(filterOptions)
    commonSearch.initRender()

    function searchUser() {
        let wrap
	    if(gugeeGobal.isMobile) {
            wrap = document.querySelector('.gd-mobile-list__wrap')
            commonSearch.hideFilter()
	    } else {
            wrap = document.querySelector('#searchTable tbody')
        }

        wrap.showLoading()
        const input = document.getElementById('insKeyword')
        params.title = (input.value)? input.value: undefined

        let url
	    if(gugeeGobal.isLogin) {
            url = getEncodeUrl('/ins/media', params)
	    } else  {
            url = getEncodeUrl('/ins/media/search', params)
        }

        commonSearch.getList(wrap, url, list => {
            let str = ''
            if(gugeeGobal.isMobile) {
                list.forEach(item => {
                    str += '<div class="user-item" data-id="' + item.id + '" data-shortcode="' + item.shortcode + '">' +
                        '<div class="user-info">' +
                        '<div class="cover">' +
                        '<img src="' + getImage(item.displayUrl, IMAGE_TYPE.MEDIA, IMAGE_SIZE.SMALL) + '" alt="image">'
                    if(item.isVideo) {
                        if(item.productType === 'feed') {
                            str += '<i class="iconfont iconinsvideo-16px"></i>'
                        } else if(item.productType === 'clips') {
                            str += '<i class="iconfont iconinstagram-reels"></i>'
                        } else {
                            str += '<i class="iconfont iconigtv"></i>'
                        }
                    } else {
                        str += '<i class="iconfont iconMultiPhoto-16px"></i>'
                    }
                    if(item.isSponsored) {
                        str += '<div class="media-sponsor">Sponsored</div>'
                    }
                    str += '</div>' +
                        '<div class="user-title">' +
                        '<div class="top"><div class="title">' + item.caption + '</div></div>' +
                        '<div class="bottom">' + formatTime(+item.takenTime, 'MM-DD-YYYY') + ' UTC '
                    if (item.score >= 90) {
                        str += '<span class="gd-score red">'
                    } else if (item.score < 90 && item.score >= 80) {
                        str += '<span class="gd-score orange">'
                    } else if (item.score < 80 && item.score >= 70) {
                        str += '<span class="gd-score green">'
                    } else {
                        str += '<span class="gd-score gray">'
                    }
                    str  += '<i class="iconfont iconhuo"></i>' + numFormat(+item.score) +
                        '</span>' +
                        '</div>' +
                        '</div>'
					if (item.collectId) {
						str += '<div class="gd-popover" content="Remove from Favorite">' +
								'<div class="icon-collect is-collect" data-id="' + item.id + '" data-fid="' + item.collectId + '" >' +
								'<i class="iconfont iconquxiaoshoucang33"></i>' +
								'</div>' +
								'</div>'
					} else {
						str += '<div class="gd-popover" content="Add to Favorite">' +
								'<div class="icon-collect" data-id="' + item.id + '">' +
								'<i class="iconfont iconshoucang"></i>' +
								'</div>' +
								'</div>'
					}
					str += '</div>' +
							'<div class="user-data">' +
							'<div class="data-item">' +
							'<div class="label">Views</div>'
                    if(+item.videoViewCount) {
                        str += '<div class="num">' + numFormat(+item.videoViewCount) + '</div>'
                    } else {
                        str += '<div class="num"> - </div>'
                    }
                    str += '</div>' +
                        '<div class="data-item">' +
                        '<div class="label">Likes</div>' +
                        '<div class="num">' + numFormat(+item.likeCount) + '</div>' +
                        '</div>' +
                        '<div class="data-item">' +
                        '<div class="label">Reviews</div>' +
                        '<div class="num">'+ numFormat(+item.commentCount) + '</div>' +
                        '</div>' +
                        '<div class="data-item">' +
                        '<div class="label">ER</div>' +
                        '<div class="num">' + numFormat(+item.er * 100) + '%</div>' +
                        '</div>' +
                        '</div>' +
                        '</div>'
                })
            } else {
                list.forEach(item => {
                    str += '<tr>' +
                        '<td>'
                    if (item.score >= 90) {
                        str += '<div class="td-score red">'
                    } else if (item.score < 90 && item.score >= 80) {
                        str += '<div class="td-score orange">'
                    } else if (item.score < 80 && item.score >= 70) {
                        str += '<div class="td-score green">'
                    } else {
                        str += '<div class="td-score gray">'
                    }
                    str +=  '<i class="iconfont iconhuo"></i>' +
                        '<span>' + numFormat(+item.score) + '</span>' +
                        '</div>' +
                        '</td>' +
                        '<td>' +
                        '<div class="td-media">' +
                        '<div class="cover">' +
                        '<img src="' + getImage(item.displayUrl, IMAGE_TYPE.MEDIA, IMAGE_SIZE.MIDDLE) + '" alt="image">'
                    if(item.isVideo) {
                        if(item.productType === 'feed') {
                            str += '<i class="iconfont iconinsvideo-16px"></i>'
                        } else if(item.productType === 'clips') {
                            str += '<i class="iconfont iconinstagram-reels"></i>'
                        } else {
                            str += '<i class="iconfont iconigtv"></i>'
                        }
                    } else {
                        str += '<i class="iconfont iconMultiPhoto-16px"></i>'
                    }
                    if(item.isSponsored) {
                        str += '<div class="media-sponsor">Sponsored</div>'
                    }
                    str += '</div>' +
                        '<div class="media-info">' +
                        '<div class="title" title="' + item.caption +'">' + item.caption + '</div>' +
                        '<div class="sub-title">' +
                        '<a href="/instagram/influencer/' + item.username + '">' +
                        '<img src="' + getImage(item.bloggerPic, IMAGE_TYPE.BLOGGER, IMAGE_SIZE.SMALL) + '" alt="image"/></a>' +
                        item.username +
                        '<div class="info-time">| ' + formatTime(+item.takenTime, 'MM-DD-YYYY') + ' UTC</div>' +
                        '</div>' +
                        '</div>' +
                        '</div>' +
                        '</td>'
                    if(item.isVideo) {
                        str += '<td>' + numFormat(+item.videoViewCount) + '</td>'
                    } else {
                        str += '<td>-</td>'
                    }
                    str += '<td>' + numFormat(+item.likeCount) + '</td>' +
                        '<td>' + numFormat(+item.commentCount) + '</td>' +
                        '<td>' + numFormat(+item.er * 100) + '%</td>'
                    str += '<td>' +
                        '<div class="td-action">' +
                        '<div class="gd-popover" content="Analyze">' +
                        '<div class="blue" data-id="' + item.id + '" data-shortcode="' + item.shortcode + '">' +
                        '<i class="iconfont iconxiangqing"></i>'+
						'</div>' +
						'</div>'
					if (item.collectId) {
						str += '<div class="gd-popover" content="Remove from Favorite">' +
								'<div class="icon-collect is-collect" data-id="' + item.id + '" data-fid="' + item.collectId + '" >' +
								'<i class="iconfont iconquxiaoshoucang33"></i>' +
								'</div>' +
								'</div>'
					} else {
						str += '<div class="gd-popover" content="Add to Favorite">' +
								'<div class="icon-collect" data-id="' + item.id + '">' +
								'<i class="iconfont iconshoucang"></i>' +
								'</div>' +
								'</div>'
					}
					str += '</div>' +
							'</td>' +
							'</tr>'
                })
            }
            return str
        }, () => {
            let list
            if(gugeeGobal.isMobile) {
                list = document.querySelectorAll('.user-item')
            } else {
                list = document.querySelectorAll('.td-action .blue')
            }
            list.forEach(item => {
                const id = item.getAttribute('data-id'), shortcode = item.getAttribute('data-shortcode')
                item.addEventListener('click', () => {
                    openDetail(id, shortcode)
                })
            })

            initPostFavorite()
        })
    }

	function initPostFavorite( element = document ){
        const collectKey = 'mid', url = '/ins/fa/media'
        element.querySelectorAll('.icon-collect').forEach(element => {
            element.addEventListener('click', event => {
                if(gugeeGobal.isMobile) {
                    collectAction({
                        element,
                        url,
                        collectKey,
                        event,
                    })
                } else {
                    collectAction({
                        element,
                        url,
                        collectKey,
                    })
                }
            })
        })
	}

    if(!gugeeGobal.isMobile) {
        const item = filterWrap.querySelector('.filter-item:nth-child(2) .item-wrap')
        item.style.display = 'grid'
        item.style.gridTemplateColumns = '1.5fr 1fr 1fr'
    }
	function filterOptions(res) {
        if (res[0].Code === 200) {
            let wrapStr = ''
            if(gugeeGobal.isMobile) {
                const wrap = document.querySelector('[data-sort-index="1"]')
                wrapStr += '<li class="is-active">All<div class="right"> <i class="iconfont iconzhichi"></i></div></li>'
                res[0].Data.forEach(item => {
                    wrapStr += '<li value="' + item.overallCategory + '">' + item.overallCategory + '</li>'
                })
                wrap.innerHTML = wrapStr
                wrap.setAttribute('data-param-key', 'category')
                wrap.setAttribute('label', 'Categories')
                commonSearch.initTabSelect()
            } else {
                const categoryPrimary = document.querySelector('.item-wrap')
                wrapStr = '<ul class="select-item" data-param-key="category">'
                wrapStr += '<li class="is-active">All</li>'
                res[0].Data.forEach(item => {
                    wrapStr += '<li value="' + item.overallCategory + '">' + item.overallCategory + '</li>'
                })
                wrapStr += '</ul>'
                categoryPrimary.innerHTML = wrapStr
            }
            commonSearch.initFilterSearch()
        }
	}
</script>
</body>
</html>
